<?php
/**
 * 邮件发送类
 * @author ChunYang.Jiang<chunyang@staff.sina.com.cn>
 * @version $Id$
 * @copyright sina
 * @date 2011-04-15
 */
class Mail
{
	public static function send($tomail, $subject, $content)
	{
		$mail = new SaeMail();
//		$ret = $mail->quickSend(
//	        $tomail,
//	        $subject ,
//	        $content ,
//	        Config::$MAIL['smtp_acct'],
//	        Config::$MAIL['smtp_pass'],
//	        Config::$MAIL['smtp_host'],
//	        Config::$MAIL['smtp_port']
//	    );
		$options = array(
			'from'	=> Config::$MAIL['smtp_acct'],
			'cc'	=> Config::$MAIL['smtp_acct'],
			'to'	=> $tomail,
			'smtp_host' => Config::$MAIL['smtp_host'],
			'smtp_port' => Config::$MAIL['smtp_port'],
			'smtp_username' => Config::$MAIL['smtp_acct'],
			'smtp_password' => Config::$MAIL['smtp_pass'],
			'subject' => $subject,
			'content' => $content,
			'content_type' => 'html',
		);
		$mail->setOpt($options);
		$ret = $mail->send();
	    if (false === $ret){
	    	Util::log('SendMail Error,ErrorNo:'. $mail->errno() .',ErrorMsg:'. $mail->errmsg());
	    }
	    return $ret;
	}
}